package com.example.Gethome.repository;

import com.example.Gethome.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserRepository extends JpaRepository<User, Integer> {

    // 根据用户名和密码查询用户信息
    @Transactional
    @Query("select u from User u where u.username = ?1 and u.password = ?2")
    List<?> findByUsernameAndPassword(String username, String password);
}
